function Pager() {
	var mountDom = '';
	var rowTotal = 0;
	var pageTotal = 0;
	var pageSize = 0;
	var pageNumber = 0;
	var ajaxUrl = '';
	var pagerConfig = '';

	// ajax请求数据 然后返回对象
	rendorAjax = function() {
		//console.log(pagerConfig._ajaxUrl);
		$.ajax({
			url: pagerConfig._ajaxUrl,
			data: 'pageSize=' + pageSize + '&pageNumber=' + pageNumber,
			dataType: 'json',
			method: 'get',
			success: function(_response) {
				//console.log('_response:' + JSON.stringify(_response));
				pagerConfig.rendorData(_response);
				//return _response;
			},
			error:function(xhr, textStatus) {
				console.log(xhr);
				//return xhr;
			}
		});
	}

	selectPage = function(_pageNumber) {
		pageNumber = _pageNumber;
		rendorPager();
		rendorAjax();
	}

	rendorPager = function() {
		// 计算分页数
		pageTotal = Math.ceil(rowTotal / pageSize);
		// 渲染html
		var pagerHtml = '';
		if(pageTotal > 0) {
			// 计算当前分页列表
			var currentPageList = Math.ceil(pageNumber / pageSize);
			var currentPageEnd = 0;
			if(currentPageList * 10 <= pageTotal) {
				currentPageEnd = currentPageList * 10;
			} else {
				currentPageEnd = pageTotal;
			}
			pagerHtml += '<ul style="margin: 0; padding: 0; list-style-type: none;">';
			if(currentPageList > 1) {
				pagerHtml += '<li style="display: inline-block; margin: 5px;"><a href="javascript:selectPage(1);" style="padding: 5px;">首页</a></li>';
			}
			if(pageNumber > 1) {
				pagerHtml += '<li style="display: inline-block; margin: 5px;"><a href="javascript:selectPage(' + (pageNumber - 1) + ');" style="padding: 5px;">上一页</a></li>';
			}
			for(var i = currentPageList * 10 - 9; i <= currentPageEnd; i ++) {
				if(i == pageNumber) {
					pagerHtml += '<li style="display: inline-block; margin: 5px;"><a href="javascript:selectPage(' + i + ');" style="padding: 5px; background-color: red;">' + i + '</a></li>';
				} else {
					pagerHtml += '<li style="display: inline-block; margin: 5px;"><a href="javascript:selectPage(' + i + ');" style="padding: 5px; background-color: green;">' + i + '</a></li>';
				}
			}
			if(pageNumber < pageTotal) {
				pagerHtml += '<li style="display: inline-block; margin: 5px;"><a href="javascript:selectPage(' + (pageNumber + 1) + ');" style="padding: 5px;">下一页</a></li>';
			}
			if(currentPageList > 1) {
				pagerHtml += '<li style="display: inline-block; margin: 5px;"><a href="javascript:selectPage(' + pageTotal + ');" style="padding: 5px;">末页</a></li>';
			}
			pagerHtml += '</ul>';
			$(mountDom).html(pagerHtml);
		} else {
			console.log('分页总数小于0，故不分页！');
		}
	}

	initPager = function(_pagerConfig) {
		pagerConfig = _pagerConfig;
		mountDom = pagerConfig._mountDom;
		rowTotal = pagerConfig._rowTotal;
		pageSize = pagerConfig._pageSize;
		
		selectPage(1);
	}
}